package com.hz.house.enums.building;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 *  楼盘标签池，包括系统打的查询用的
 * @author lfw
 *
 */
public enum BuildingTagEnum {
	
	/**
	 *********************************************
	 **				ATTENTION			        **
	 **			枚举的顺序不能随便换啊啊啊啊		    	**
	 *********************************************
	 */
	//属于类别标签部分
	SCHOOL_HOUSE(14,"学区房",2),//学区房，类型为自定义
	//地铁标签
	SUBWAY_ONE(7,"地铁房",1),//地铁房
	SUBWAY_TWO(8,"双地铁",1),//双地铁
	SUBWAY_THREE(9,"三地铁",1),//三地铁
	TOD(15,"TOD",2),//tod，我也不知道是啥
	PARK_HOUSE(16,"公园盘",2),//公园盘
	RIVER_HOUSE(17,"河景房",2),//河景房
	LAKE_HOUSE(18,"湖景房",2),
	HOLIDAY_HOUSE(19,"度假盘",2),
	HIGH_HOUSE(20,"小高层",2),
	YANG_HOUSE(21,"洋房",2),
	YUE_CENG(27,"跃层",2),
	//物业类型标签
	VILLA(10,"别墅",1),
	APARTMENT(11,"商办",1),
	YANGFANG(28,"洋房",1), 
	SHANGPU(29,"商铺",1), 
	XIEZILOU(30,"写字楼",1), 
	RENCAIGONGYU(31,"人才公寓",1),
	SHANGSHU(32,"商墅",1),
	
	//洋房、商铺、人才公寓
	//属于其他标签部分
	GREEN_HOUSE(22,"绿色住宅",2),
	TECH_HOUSE(23,"科技住宅",2),
	NEW_WIND(24,"带新风",2),
	WARM_HOUSE(25,"带地暖",2),
	JIAN_DAO_CHA(26,"剪刀差",2),
	//区域相关标签
	NOT_LIMIT_BUY(12,"不限购",1),//不限购标签，区域是成都周边的打上这个标签
	//售卖状态相关的标签
	NOT_YAOHAO(13,"不摇号",1);//不摇号，摇号剩余的打上这个标签
		 
 
	
	private int id;
	private String name;
	private int type;//1系统2自定义
	
	BuildingTagEnum(int id,String name,int type){
		this.id=id;
		this.name=name;
		this.type=type;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public int getType() {
		return type;
	}
	
	
	/**
	 * 获取所有的自定义标签
	 * @return
	 */
	public static List<BuildingTagEnum> getUserDefindTags(){
		
		BuildingTagEnum[] all = BuildingTagEnum.values();
		List<BuildingTagEnum> udt = new ArrayList<>();
		for(BuildingTagEnum t:all) {
			if(t.getType()==2)
				udt.add(t);
		}
		return udt;
	}
	
	/***
	 * 根据标签的id获取标签
	 * @param id
	 * @return
	 */
	public static BuildingTagEnum getTagById(int id) {
		for(BuildingTagEnum t:BuildingTagEnum.values()) {
			if(t.getId()==id)
				return t;
		}
		return null;	
	}
	
	/**
	 * 获取所有标签的对象
	 * @return
	 */
	public static List<BuildingTagEnum> getAllTags(){
		return Arrays.asList(BuildingTagEnum.values());
	}
	 
}
